package com.estate.util;

import lombok.Data;

import java.io.Serializable;

@Data
public class JsonResult<T> implements Serializable {

    private Boolean success;
    private T data;
    private Integer code;
    private String error;

    public JsonResult() {
    }

    public JsonResult(T data) {
        this.success = true;
        this.data = data;
        this.code = 200;
    }

    public JsonResult(Integer code, String error) {
        this.code = code;
        this.error = error;
        this.success = false;
    }
}